home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 July / EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso / lightwave / plugins / gonzalomacros / install-macros-v1.2 < prev    next >
Text File  |  1996-07-15  |  9KB  |  406 lines

  1. ;**********************************************************
  2. ;                                                           
  3. ;    Gonzalo Garramuño's Macro Compilation Installer       
  4. ;                                                          
  5. ;                  by Gonzalo Garramuño                    
  6. ;                © 1996 Gonzalo Garramuño                  
  7. ;                                                          
  8. ;$VER: Gonzalo Garramuño's Macro Compilation Installer 1.0 
  9. ;                                                          
  10. ;**********************************************************
  11.  
  12. ;************* Initialize **************
  13. (set @app-name "Gonzalo Garramuño's Macro Compilation")
  14. (set @user-level 1)
  15. (set drive_macros
  16.     (if (= 2 (exists "Gonzalo:" (noreq)))
  17.         (pathonly (getassign "Gonzalo"))
  18.         (if (= 2 (exists "REXX:Modeler" (noreq)))
  19.             "REXX:Modeler"
  20.             "Toaster:ARexx_Examples/lwm"
  21.         )
  22.     )
  23. )
  24.  
  25. (set drive_macrolist
  26.     (if (= 2 (exists "GonzaloList:" (noreq)))
  27.         (getassign "GonzaloList")
  28.         (if  (= 2 (exists "Toaster:Programs/Lightwave_Support" (noreq)))
  29.             "Toaster:Programs/Lightwave_Support"
  30.             "Toaster:3D"
  31.         )
  32.     )
  33. )
  34.  
  35. (set guide_dir
  36.     (if (= 2 (exists "Toaster:Programs/Documentation" (noreq)))
  37.         "Toaster:Programs/Documentation"
  38.         (if (= 2 (exists "Work:" (noreq)))
  39.             "Work:"
  40.             (cat (getdevice "c:") ":")
  41.         )
  42.     )
  43. )
  44.  
  45. (set @default-dest drive_macros)
  46.  
  47. (set source_dir (cat (pathonly @icon)))
  48.  
  49. (set slash
  50.     (if (= ":" (substr source_dir (- (strlen source_dir) 1) 1))
  51.             ""
  52.             "/"
  53.     )
  54. )
  55. (set source_dir (cat source_dir slash))
  56.  
  57. ;****** Help Messages ******
  58. (set help_msg1
  59.     (cat    "The Installer needs to know where you would like to "
  60.         "install the macros.\n\nFor LW 4.0+, you will probably "
  61.         "want to choose 'REXX:Modeler', while for LW 3.5, "
  62.         "you probably want to choose "
  63.         "'Toaster:ARexx_Examples/lwm'.\n\n"
  64.         "The installer will create a directory called "
  65.         "'Gonzalo' (if it does not exist already), where it "
  66.         "will put all of the macros."
  67.     )
  68. )
  69.  
  70. (set help_msg2
  71.     (cat    "The Installer needs to know where to install the "
  72.         "GonzaloMacroList file.  The Amigaguide help file "
  73.         "will also be installed here.\n\n"
  74.         "On LW 4.0, the standard place for the macrolist is "
  75.         "'Toaster:Programs/Lightwave_Support'.  "
  76.         "For LW 3.5, the usual place was 'Toaster:3D'."
  77.     )
  78. )
  79.  
  80. (set help_msg3
  81.     (cat    "The Installer needs to know where to install the "
  82.         "AmigaGuide instructions.\n\nYou can install this "
  83.         "file anywhere you want.  A new drawer called "
  84.         "GonzaMacros will be created.\n"
  85.     )
  86. )
  87. (set help_msg4
  88.     (cat    "The Mouth Animation is used with the Exposure Sheet "
  89.         "macro.\n"
  90.         "All other animations are just examples of what some "
  91.         "of the macros can do.\n\n"
  92.         "Some buttons in the AmigaGuide instructions have links "
  93.         "to these animations.  If you don't install them, then "
  94.         "those buttons will not work."
  95.     )
  96. )
  97.  
  98. (set help_msg5
  99.     (cat    "These picture files try to clarify even more the "
  100.         "AmigaGuide instructions.  For example, there is "
  101.         "a group of images that show you graphically each "
  102.         "step in one tutorial.\n\n"
  103.         "Some buttons in the AmigaGuide instructions have links "
  104.         "to these pictures.  If you don't install them, then "
  105.         "those buttons will not work."
  106.     )
  107. )
  108.  
  109. (set user_startup_help
  110.     (cat    "These commands need to be added to your User-"
  111.         "Startup file in order for the macros to "
  112.         "function properly.  "
  113.         "These commands will then be automatically run at "
  114.         "boot up."
  115.     )
  116. )
  117.  
  118. ;****** Function Definitions ******
  119.  
  120. (procedure SET_SIZES
  121.     (
  122.         (set macros_size    300000)
  123.         (set macrolist_size       800)
  124.         (set guide_size        230000) ; guide + viewtek
  125.         (set pics_size        202000)
  126.     )
  127. )
  128.  
  129. (procedure GETPATHMACROS
  130.     (set macros_dir
  131.         (askdir
  132.             (prompt "Please select the drive where you would "
  133.                     "like to install Gonzalo Garramuño's Macro "
  134.                     "Compilation. A new drawer called 'Gonzalo' "
  135.                     "will be created there, if it does not exist.")
  136.             (default drive_macros)
  137.             (help help_msg1)
  138.         )
  139.     )
  140.     (set slash
  141.         (if (= ":" (substr macros_dir (- (strlen macros_dir) 1) 1))
  142.             ""
  143.             "/"
  144.         )
  145.     )
  146.     (set macros_dir
  147.         (expandpath(macros_dir))
  148.     )
  149.     (set macros_dir
  150.         (cat macros_dir slash "Gonzalo")
  151.     )
  152.  
  153.     (if (= 0 (exists macros_dir))
  154.         (makedir macros_dir (infos))
  155.     )
  156.     (set @default-dest macros_dir)
  157. )
  158.  
  159. (procedure GETPATHMACROLIST
  160.     (set macrolist_dir
  161.         (askdir 
  162.             (prompt "Please select the place where you would "
  163.                     "like to install the file 'GonzaloMacroList'."
  164.                     "This file is a list of the names of all the "
  165.                     "macros and is used by Modeler.")
  166.             (default drive_macrolist)
  167.             (help help_msg2))
  168.     )
  169.     (set slash (if (= ":" (substr macrolist_dir 
  170.                     (- (strlen macrolist_dir) 1) 1))
  171.                     ""
  172.                     "/"
  173.                 )
  174.     )
  175. )
  176.  
  177. (procedure GETPATHAMIGAGUIDELIST
  178.     (set guide_dir (askdir 
  179.         (prompt "Please select the place where you would "
  180.                 "like to install the AmigaGuide Instructions.\n"
  181.                 "A new drawer called GonzaMacros will be created "
  182.                 "there.  Some utilities are also installed.")
  183.             (default guide_dir)
  184.             (help help_msg3)))
  185.     (set slash (if    (= ":" (substr guide_dir 
  186.                 (- (strlen guide_dir) 1) 1))
  187.                     ""
  188.                     "/"
  189.                 )
  190.     )
  191. )
  192.  
  193. (procedure INSTALLMACROS
  194.     (copyfiles
  195.             (source    (cat source_dir "Macros"))
  196.             (dest    (cat macros_dir))
  197.             (optional "fail" "force")
  198.             (all)
  199.             (infos)
  200.     )
  201. )
  202.  
  203. (procedure INSTALLMACROLIST
  204.     (copyfiles
  205.             (source    (cat source_dir "GonzaloMacroList"))
  206.             (dest    (cat macrolist_dir))
  207.             (optional "fail" "force")
  208.             (infos)
  209.     )
  210. )
  211.  
  212. (procedure INSTALLGUIDE
  213.     (set guide_dir
  214.         (cat guide_dir slash "GonzaMacros")
  215.     )
  216.     (set disk_avail (getdiskspace (cat (getdevice guide_dir) ":")))
  217.     (if (> guide_size disk_avail)
  218.         (WARNSIZE)
  219.     )
  220.     (copyfiles
  221.         (source    (cat source_dir "GonzaloMacros.guide"))
  222.         (dest    (cat guide_dir))
  223.         (optional "fail" "force")
  224.         (infos)
  225.     )
  226.     (copyfiles
  227.         (source    (cat source_dir "Utils"))
  228.         (dest    (cat guide_dir "/Utils"))
  229.         (all)
  230.         (optional "fail" "force")
  231.         (infos)
  232.     )
  233. )
  234.  
  235. (procedure INSTALLANIMS
  236.     (set anim_dir (cat source_dir "Anims/"))
  237.     (set copyanims
  238.         (askoptions
  239.             (prompt "Which animations do you want to copy?")
  240.             (help help_msg4)
  241.             (choices    "Mouth Animation (4K)"
  242.                     "Patch This / Exposure Sheet Example (150K)"
  243.                     "Break / Explosion Example (220K)"
  244.             )
  245.             (default 7)
  246.         )
  247.     )
  248.  
  249.     (set guide_dir (cat guide_dir "/Anims"))
  250.     (if (BITAND copyanims 1)
  251.         (
  252.             (set disk_avail (getdiskspace (cat (getdevice guide_dir) ":")))
  253.             (if (> 400 disk_avail)
  254.                     (WARNSIZE)
  255.             )
  256.             (copyfiles
  257.                 (source    (cat anim_dir "mouth.anim"))
  258.                 (dest    guide_dir)
  259.                 (optional "fail" "force")
  260.             )
  261.         )
  262.     )
  263.     (if (BITAND copyanims 2)
  264.         (
  265.             (set disk_avail (getdiskspace (cat (getdevice guide_dir) ":")))
  266.             (if (> 150000 disk_avail)
  267.                     (WARNSIZE)
  268.             )
  269.             (copyfiles
  270.                 (source    (cat anim_dir "chip.anim"))
  271.                 (dest    guide_dir)
  272.                 (optional "fail" "force")
  273.             )
  274.         )
  275.     )
  276.     (if (BITAND copyanims 3)
  277.         (
  278.             (set disk_avail (getdiskspace (cat (getdevice guide_dir) ":")))
  279.             (if (> 220000 disk_avail)
  280.                     (WARNSIZE)
  281.             )
  282.             (copyfiles
  283.                 (source    (cat anim_dir "explosion.anim"))
  284.                 (dest    guide_dir)
  285.                 (optional "fail" "force")
  286.             )
  287.         )
  288.     )
  289.  
  290. )
  291.  
  292. (procedure INSTALLPICTURES
  293.     (set copypics
  294.         (askbool
  295.             (prompt "Do you want to copy the images used in the "
  296.                     "AmigaGuide tutorials?")
  297.             (help help_msg5)
  298.             (default 1)
  299.         )
  300.     )
  301.  
  302.     (if (= copypics 1)
  303.         (
  304.             (set disk_avail (getdiskspace (cat (getdevice guide_dir) ":")))
  305.             (if (> pics_size disk_avail)
  306.                     (WARNSIZE)
  307.             )
  308.             (copyfiles
  309.                 (source (cat source_dir "Pictures"))
  310.                 (dest (cat guide_dir "/Pictures"))
  311.                 (all)
  312.                 (optional "fail" "force")
  313.             )
  314.         )
  315.     )
  316. )
  317.  
  318. (procedure WARNSIZE
  319.     (message (cat    "WARNING!!!\n\n"
  320.                 "There may not be enough space on your drive to "
  321.                 "install this part of the Macro Compilation.  "
  322.                 "Please make more space on your hard drive to "
  323.                 "to finish the installation, before proceeding.\n\n"
  324.                 "Click proceed to continue..."))
  325. )
  326.  
  327. (procedure DOSTARTUP
  328.     (set start_lines
  329.         (cat "assign Gonzalo: " macros_dir " add\n")
  330.     )
  331.     (set start_lines
  332.         (cat start_lines "assign GonzaloList: " macrolist_dir)
  333.     )
  334.     (makeassign "Gonzalo" (cat (macros_dir)))
  335.     (makeassign "GonzaloList" (cat (macrolist_dir)))
  336.     (startup "Gonzalo Garramuño's Macro Compilation"
  337.         (command start_lines)
  338.         (help user_startup_help)
  339.         (prompt
  340.             (cat "\n\nThe following lines must be added to "
  341.                  "your user-startup file:\n\n" start_lines
  342.             )
  343.         )
  344.     )
  345. )
  346.  
  347. ;****** Main Program ******
  348.  
  349. (welcome)
  350. (complete 0)
  351.  
  352. (SET_SIZES)
  353.  
  354. (GETPATHMACROS)
  355. (set disk_avail (getdiskspace (cat (getdevice macros_dir) ":")))
  356. (if (> macros_size disk_avail)
  357.         (WARNSIZE)
  358. )
  359. (if (exists "Gonzalo:Curve2PolySeg.LWM" (noreq))
  360.     ((delete "Gonzalo:Curve2PolySeg.LWM" (optional force))
  361.         (delete "Gonzalo:Curve2PolySeg.LWM.exe" (optional force))
  362.         (delete "Gonzalo:Curve2PolySeg.LWM.exe.info" (optional force))
  363.     )
  364. )
  365.  
  366. (INSTALLMACROS)
  367. (complete 50)
  368. (GETPATHMACROLIST)
  369. (set disk_avail (getdiskspace (cat (getdevice macros_dir) ":")))
  370. (if (> macrolist_size disk_avail)
  371.     (WARNSIZE)
  372. )
  373. (INSTALLMACROLIST)
  374. (complete 60)
  375. (GETPATHAMIGAGUIDELIST)
  376. (INSTALLGUIDE)
  377. (complete 70)
  378. (INSTALLPICTURES)
  379. (complete 80)
  380. (INSTALLANIMS)
  381. (complete 90)
  382.  
  383. ; Choose default tool for guide, depending on user's OS version
  384. (set osversion  (/ (getversion) 65536))
  385. (if (>= osversion 39)
  386.     (set guide_reader "MultiView")
  387.     (set guide_reader "AmigaGuide")
  388. )
  389.  
  390. (if (exists (tackon macrolist_dir "GonzaloMacros.guide.info") (noreq))
  391.     (
  392.         (tooltype
  393.             (dest (tackon macrolist_dir "GonzaloMacros.guide"))
  394.             (noposition)
  395.             (setdefaulttool guide_reader)
  396.         )
  397.     )
  398. )
  399.  
  400. (DOSTARTUP)
  401. (complete 95)
  402. ;(SHOWREADME)
  403.  
  404. (complete 100)
  405.  
  406.